package com.shensi.api.admin.client.integral;

import com.shensi.api.admin.client.fallback.integral.IntegralWaresClientFallBack;
import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.integral.dto.IntegralWaresDto;
import com.shensi.common.core.annotation.Log;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.domain.model.LoginUser;
import com.shensi.common.core.enums.BusinessType;
import com.shensi.common.core.page.TableDataInfo;
import com.shensi.common.core.utils.DateUtils;
import com.shensi.common.core.utils.SecurityUtils;
import com.shensi.common.core.utils.poi.ExcelUtil;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.ArrayList;
import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = IntegralWaresClientFallBack.class)
@Component
public interface IntegralWaresClient {

    /**
     * 查询积分商品管理列表
     */
    @GetMapping("/integral/wares/list")
    public TableDataInfo list(@SpringQueryMap IntegralWaresDto integralWares);

    /**
     * 导出积分商品管理列表
     */
    @GetMapping("/integral/wares/export")
    public AjaxResult export(@SpringQueryMap IntegralWaresDto integralWares);

    /**
     * 获取积分商品管理详细信息
     */
    @GetMapping(value = "/integral/wares/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id);

    /**
     * 新增积分商品管理
     */
    @PostMapping("/integral/wares")
    public AjaxResult add(@RequestBody IntegralWaresDto integralWares);

    /**
     * 修改积分商品管理。默认删除再做新增
     */
    @PutMapping("/integral/wares")
    public AjaxResult edit(@RequestBody IntegralWaresDto integralWares);

    /**
     * 修改积分商品管理
     */
    @PostMapping(value = "/integral/wares/editInfoWares")
    public AjaxResult editInfoWares(@RequestBody IntegralWaresDto integralWares);


    /**
     * 删除积分商品管理
     */
    @Log(title = "积分商品管理", businessType = BusinessType.DELETE)
    @DeleteMapping("/integral/wares/{ids}")
    public AjaxResult remove(@PathVariable("ids") Long[] ids);
}
